Code References
The great thing about UnIStorm is its ability to be fully customizable, even programmatically. UniStorm has many variables that can be accessed through programming. Accessing in-game variables can also be useful to add to player immersion. Lets say, for example, you want a player to be affected by the current temperature. If the temperature is greater than 32 degrees, the player is at a safe temperature, but anything below that would be considered dangerous. Lower temperatures could harm your player, or slow their ability to do certain tasks. This is all possible with UniStorm and many other variables. UniStorm's Accessable Variables: For conveniency, we have categorized the sets of variables into categories: *Time *Weather *Temperature *Sky *Sun *Moon *GUI Note Note: You must first reference the UniStorm Weather System script within your scene. To do this you will find it at on the start function. (Be sure not to rename the GameObject that the weather system script is attached to, if you have you would simply change the name to whatever you renamed it to.) 1) First you will want to create a new script, this can be JavaScript or C#. 2) You will then add this variable at the top of your newly created script. JavaScript: var UniStormWeatherScript : GameObject; C#: public GameObject UniStormWeatherScript; 3) Now you need to find the UniStorm Script on Start, add this code to the Start function. JavaScript: UniStormWeatherSystemScript = GameObject.Find("UniStormSystemEditor"); C#: UniStormWeatherSystemScript = GameObject.Find("UniStormSystemEditor"); 4) Now you have get the script in order to access UniStorm's variables. You do thing by calling GetComponent. If you know the variable you would like to access or change you type it in like the below example. For our example we will be using the current temperature variable in an if statement to check whether or not it is below freezing. JavaScript: if (UniStormWeatherSystemScript.GetComponent(UniStormWeatherSystem_JS).temperature >= 33) { Debug.Log("It is above freezing"); } if (UniStormWeatherSystemScript.GetComponent(UniStormWeatherSystem_JS).temperature <= 32) { Debug.Log("It is below freezing"); } C# if (UniStormWeatherSystemScript.GetComponent().temperature >= 33) { Debug.Log("It is above freezing"); } if (UniStormWeatherSystemScript.GetComponent().temperature <= 32) { Debug.Log("It is below freezing"); } Now you have finished setting up a test script to access UniStorm's variables. For a list to all the variables that UniStorm has use the code reference categories above. Time While UniStorm is a weather system it has many more features than you'd think. UniStorm offers time tracking and real in-game time. In-game time can have many benefits and add new features to a game. in-game time can do amazing things to add to player immersion and believability. You can have certain people appear only on certain days or hours to give a quest. You can have certain quest related objects only appear at night. You can have lights light up an entire city, but only at night. This, and much more, is all possible with the UniStorm Weather System. There are a total of 5 time keeping variables that UniStorm uses. We will discuss each on below. Important: Please be sure that you have already followed and understand the "Note" help above. It contains essential information to get you started. Beyond this sentence we assume you have already followed and understand how to reference UniStorm. Minutes: Minutes are UniStorm's fastest moving time variables so they usually aren't associated with any script related tasks. However, since some of you may find it useful we will supply an example. JavaScript: UniStormWeatherSystemScript.GetComponent(UniStormWeatherSystem_JS).minuteCounter C#: UniStormWeatherSystemScript.GetComponent().minuteCounter Hours: Hours are vary useful for anything related for a day task. UniStorm uses 24 hour notation so be sure to follow it while programming. JavaScript: UniStormWeatherSystemScript.GetComponent(UniStormWeatherSystem_JS).hourCounter C#: UniStormWeatherSystemScript.GetComponent().hourCounter Days: Days can be useful for things like daily tasks, ability resets, daily quests, ect. JavaScript: UniStormWeatherSystemScript.GetComponent(UniStormWeatherSystem_JS).dayCounter C#: UniStormWeatherSystemScript.GetComponent().dayCounter